﻿using System;

namespace Token.Piker.Web.Admin.Activity
{
    public partial class Show : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
            {
                string strid = Request.Params["id"];
                int ID = (Convert.ToInt32(strid));
                ShowInfo(ID);
            }
        }

        private void ShowInfo(int ID)
        {
            Token.Piker.BLL.ActivityBLL bll = new Token.Piker.BLL.ActivityBLL();
            Token.Piker.Model.Activity model = bll.GetModel(ID);
            int id = (int)model.Creator;
            Token.Piker.Model.Admin admin = (new Token.Piker.BLL.AdminBLL()).GetModel(id);
            this.lblCreator.Text = admin.RealName;
            this.lblTheme.Text = model.Theme;
            this.lblDescrip.Text = model.Descrip;
            this.lblAward.Text = model.Award;
            this.lblStartTime.Text = ((DateTime)model.StartTime).ToLongDateString();
            this.lblEndTime.Text = ((DateTime)model.EndTime).ToLongDateString();
            this.lblPosition.Text = model.Position;
            this.lblPartCount.Text = model.PartCount.ToString();
            this.AnchorBackgroundImg.HRef = "ShowBackgroundImg.aspx?SRC=" + model.BackgroundImg;
            this.lblFlag.Text = model.Flag.ToString()=="0"?"线上活动":"线下活动";
        }
    }
}